package com.kingdee.eas.hr.affair.client;

import java.sql.SQLException;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.ctrl.kdf.table.IRow;
import com.kingdee.bos.ctrl.kdf.table.KDTable;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
import com.kingdee.eas.basedata.person.PersonInfo;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.fdc.basedata.FDCSQLBuilder;
import com.kingdee.eas.hr.cifihr.BelongFactory;
import com.kingdee.eas.hr.cifihr.BelongInfo;
import com.kingdee.jdbc.rowset.IRowSet;

public class FlucOutBizBillEditUIBizCTEx extends FlucOutBizBillEditUIBiz {
	
	protected void addLineByPerson(KDTable table, IRow row, PersonInfo info) {
		super.addLineByPerson(table, row, info);
		FDCSQLBuilder sql = new FDCSQLBuilder();
		sql.appendSql("select  cfBelongID from T_BD_Person where  fid='"+ info.getId().toString() + "'");
		String blongID = null;
		String oldcompanyID=null;
		IRowSet rowset = null;
		try {
			rowset = sql.executeQuery();
		} catch (BOSException e1) {
			e1.printStackTrace();
		}
		 try {
			while(rowset.next()){
				 blongID = rowset.getString("cfBelongID");
				 try {
					BelongInfo bInfo = BelongFactory.getRemoteInstance().getBelongInfo(new ObjectUuidPK(blongID));
					row.getCell("oldBlong").setValue(bInfo);
				} catch (EASBizException e) {
					e.printStackTrace();
				} catch (BOSException e) {
					e.printStackTrace();
				}
				 break;
			 }
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
}
